Trust Evaluation#465
Conversation
3eb01ce to
2115232
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
e0b2b52 to
59c9d87
Compare
| * Use VC-K data classes to (de-)serialize received/emitted data | ||
| * Add support for iOS using ISO/IEC 18013-7 Annex C protocol | ||
| * Add support for issuance via the DC API based on the preliminary spec defined in https://github.com/openid/OpenID4VCI/pull/476 | ||
| * Add `TrustListService` for loading LoTE regularly in the background |
| "https://acceptance.trust.tech.ec.europa.eu/lists/eudiw/wallet-providers.json", | ||
| "https://acceptance.trust.tech.ec.europa.eu/lists/eudiw/wrpac-providers.json", | ||
| "https://acceptance.trust.tech.ec.europa.eu/lists/eudiw/mdl-providers.json", | ||
| "https://trust.tech.ec.europa.eu/lists/eudiw/pub-eaa-providers.json" |
There was a problem hiding this comment.
| "https://trust.tech.ec.europa.eu/lists/eudiw/pub-eaa-providers.json" | |
| "https://acceptance.trust.tech.ec.europa.eu/lists/eudiw/pub-eaa-providers.json" |
| val ASIT_PLUS_PROVIDERS = "${PREFIX}asit_plus_providers" | ||
|
|
||
|
|
||
| fun mapUrlToKey(url: String): String? = when { |
| fun TrustStatusBanner(trustState: TrustState, modifier: Modifier = Modifier) { | ||
| val (backgroundColor, contentColor, icon, text) = when (trustState) { | ||
| TrustState.TRUSTED -> listOf( | ||
| Color(0xFFE8F5E9), Color(0xFF2E7D32), |
There was a problem hiding this comment.
Please extract to resources, particularly the strings
| private val verifyJwsObject: VerifyJwsObjectFun = VerifyJwsObjectJades(), | ||
| ) { | ||
| private var job: Job? = null | ||
| val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default) |
There was a problem hiding this comment.
why not use the existing sessionCoroutineScope (see CredentialValidityService)
| trustLists: List<ListOfTrustedEntities>, | ||
| serviceType: String | ||
| ): TrustState { | ||
| return try { |
There was a problem hiding this comment.
cen be converted to a expression body
|
|
||
| val responseBody = response.bodyAsText() | ||
|
|
||
| val jws = JwsCompact.parse<TrustListPayload>(responseBody).getOrThrow() |
There was a problem hiding this comment.
why not converting directly like in https://ktor.io/docs/client-responses.html#json
| verifyJwsObject(jws.first).getOrThrow() | ||
|
|
||
| Napier.i("Successfully validated Trust List signature from $url") | ||
|
|
|
|
||
| if (validationResult.isSuccess) TrustState.TRUSTED else TrustState.UNTRUSTED | ||
| } catch (_: Exception) { | ||
| TrustState.UNTRUSTED |
There was a problem hiding this comment.
Wouldn't UNKNOWN be better suited here? Also we should at least log the exception so Developers can see that something went wrong
| val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default) | ||
| private val client = httpService.buildHttpClient() | ||
| // A-SIT trust list | ||
| val aistIssuerCert = X509Certificate.decodeFromPem(asitRootPem).getOrThrow() |
TrustListServicefor loading LoTE regularly in the background